
from selenium import webdriver
import time

# PhantomJS
# executable_path=r'E:\迅雷下载\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin\phantomjs.exe'
# driver = webdriver.PhantomJS()
# # 打开百度页面
# driver.get('https://www.baidu.com/')
#
# # 定位操作
# driver.find_element_by_id('kw').send_keys('python')
# driver.find_element_by_id('su').click()
#
# # 查看信息
# # 查看页面源代码
# # print(driver.page_source)
# # 当前请求的URL地址
# print(driver.current_url)
#
# # 保存截图
# driver.save_screenshot('juran.png')

# selenium

driver = webdriver.Chrome()

# 打开网址
driver.get('https://www.baidu.com/')
cookie = driver.get_cookies()
print(cookie)
# 窗口最大化
driver.maximize_window()

time.sleep(3)

# 关闭当前的窗口
driver.close()
time.sleep(1)

# 退出浏览器
driver.quit()





